package com.ffws.carInfo.api;

import com.ffws.base.model.Label;
import com.ffws.base.model.RestResponse;
import com.ffws.carInfo.model.dto.FireCarDto;
import com.ffws.carInfo.model.po.FireHydrant;
import com.ffws.carInfo.service.CarInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author JC
 * @description TODO
 * @Date 2023-9-3 20:42
 * @Version 1.0
 */
@RestController
@Api(value = "人车管控的接口", tags = "人车管控的接口")
public class CarInfoController {

    @Autowired
    CarInfoService carInfoService;

    @GetMapping("/getAllFireCars")
    @ApiOperation(value = "得到该地区所有车辆信息")
    public RestResponse<List<FireCarDto>> getAllFireCars(@RequestParam("tabId") @ApiParam("标签id") Long tabId) {
        return carInfoService.getAllFireCars(tabId);
    }

    @ApiOperation(value = "得到该地区的实时情况")
    @GetMapping("/getRealTimeStatus")
    public RestResponse<List<Label>> getRealTimeStatus(@RequestParam("tabId") @ApiParam("标签id") Long tabId) {
        return carInfoService.getRealTimeStatus(tabId);
    }

    @ApiOperation(value = "得到该地区所有消防栓")
    @GetMapping("/getFireHydrants")
    public RestResponse<List<FireHydrant>> getAllFireHydrant(@RequestParam("tabId") @ApiParam("标签id") Long tabId) {
        return carInfoService.getAllFireHydrant(tabId);
    }

}
